Repository navigation
fix(v10/nextjs): Apply top-level bundleSizeOptimizations to webpack and Turbopack builds - #25261
Merged
andreiborza merged 1 commit intoOct 12, 2026
Conversation
… and Turbopack builds Backport of: #24818
Contributor
size-limit report 📦
|
andreiborza
approved these changes
Oct 12, 2026
nicohrubec
approved these changes
Oct 12, 2026
andreiborza
deleted the
backport/v10-24818-nextjs-bundle-size-optimizations
branch
October 12, 2026 11:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of: #24818
Differences to the original PR
packages/nextjs/src/{client,edge,server}/index.ts: thedebug: truewarning still mentionswithSentryConfig({ disableLogger: true }). v10 still has the deprecateddisableLoggeroption, which develop removed. The message now listsbundleSizeOptimizations.excludeDebugStatements: true,withSentryConfig({ disableLogger: true }), andwebpack.treeshake.removeDebugLogging: true.packages/nextjs/src/config/types.ts: left out the TODO comment change on the closing brace of_experimental.turbopackReactComponentAnnotation. On v10 that line has noTODO(v12)comment to replace. This only affects a comment.packages/nextjs/src/config/withSentryConfig/getFinalConfigObjectBundlerUtils.ts: the../utilimport leaves outsupportsTurbopackRuleCondition, which v10 doesn't have. The newgetTreeshakeDefinesimport is unchanged.packages/nextjs/test/config/webpack/constructWebpackConfig.test.ts: the new test spies oncore.loadModuleinstead ofcoreServer.loadModule. On v10 this test file imports@sentry/coreascoreand has nocoreServerimport.packages/nextjs/test/config/withSentryConfig.test.ts: the existing v10 testadds a turbopack note when the deprecated option only applies to webpacknow passes{ ...exportedNextConfig }instead of the shared fixture. On v10,disableLoggermaps towebpack.treeshake.removeDebugLogging. With Turbopack enabled, the newmaybeSetTurbopackTreeshakeDefineswritescompiler.defineonto the passed config. That change leaked into the shared fixture and broke the new Turbopack treeshake tests. This only changes tests.Reviewer note: because
disableLoggermaps towebpack.treeshake.removeDebugLoggingon v10,disableLogger: truenow also removes debug logging in Turbopack builds. The existing deprecation warning fordisableLoggerstill adds "(Not supported with Turbopack.)". This backport leaves that warning unchanged.via Junior system actor
junior.--
View Junior Session [Sentry]